package com.maimao.model.dynamicform.props;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

/**
 * 动态表单属性配置——文本输入框
 * @author MaoLin Wang
 * @date 2020/12/19 9:12 下午
 */
@JsonInclude(JsonInclude.Include.NON_NULL)

public class InputProps  extends Props implements Serializable {

    private static final long serialVersionUID = -1210699555585967715L;
    private String type;
    private boolean clearable;
    private boolean readonly;
    /**
     * 文本域默认行数，仅在 textarea 类型下有效
     */
    private Integer rows;
    /**
     * 自适应内容高度，仅在 textarea 类型下有效，可传入对象，如 { minRows: 2, maxRows: 6 }
     */
    private boolean autosize;
    /**
     * 将用户的输入转换为 Number 类型
     */
    private boolean number;
    private boolean autofocus;
    /**
     * off 和on
     */
    private String autocomplete;
    private String placeholder;

    private boolean required;

    public InputProps() {
        type="text";
        rows=4;
        autocomplete="off";
        placeholder="请输入%s";

    }
    public InputProps(String placeholder) {
        type="text";
        rows=4;
        autocomplete="off";
        placeholder="请输入"+placeholder;

    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isClearable() {
        return clearable;
    }

    public void setClearable(boolean clearable) {
        this.clearable = clearable;
    }

    public boolean isReadonly() {
        return readonly;
    }

    public void setReadonly(boolean readonly) {
        this.readonly = readonly;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public boolean isAutosize() {
        return autosize;
    }

    public void setAutosize(boolean autosize) {
        this.autosize = autosize;
    }

    public boolean isNumber() {
        return number;
    }

    public void setNumber(boolean number) {
        this.number = number;
    }

    public boolean isAutofocus() {
        return autofocus;
    }

    public void setAutofocus(boolean autofocus) {
        this.autofocus = autofocus;
    }

    public String getAutocomplete() {
        return autocomplete;
    }

    public void setAutocomplete(String autocomplete) {
        this.autocomplete = autocomplete;
    }

    public String getPlaceholder() {
        return placeholder;
    }

    public void setPlaceholder(String placeholder) {
        this.placeholder = placeholder;
    }

    public boolean isRequired() {
        return required;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }
}
